<template>
  <pro-provider :content-width="contentWidth">
    <router-view v-slot="{ Component }">
      <component :is="Component" />
    </router-view>
  </pro-provider>
</template>
<script lang="ts">
import { useMultiTab } from '@/components/multi-tab/multi-tab-store';
import { useRoute } from 'vue-router';

export default defineComponent({
  setup() {
    const route = useRoute();
    const [{ refresh, clearCache }] = useMultiTab(/* { defaultHomePage: props.defaultHomePage } */);
    // 刷新当前路由
    window.refreshMicroTab = (routerPath) => {
      if (routerPath === route.path) {
        refresh(routerPath);
      }
    };
    // 清楚缓存
    window.clearMicroCache = (routerPath) => {
      clearCache(routerPath);
    };
  }
});
</script>
<style lang="less" scoped>
.micro-layout-wrapper {
  background: #e8edf7;
  height: 100%;
}
</style>
